package com.example.finalcode;

import android.os.Bundle;
import android.app.Activity;
import android.content.Intent;
import android.view.Menu;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;

public class ThirdActivity extends Activity {
	private Button btnrst;
	private Button btnhome;
	private TextView tvend;
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_third);
		initView();
		initHandler();
	}

	private void initHandler() {
		// TODO Auto-generated method stub
		btnrst.setOnClickListener(new View.OnClickListener() {
			
			@Override
			public void onClick(View v) {
				// TODO Auto-generated method stub
				Intent it = new Intent();
				it.setClass(ThirdActivity.this, SecondActivity.class);
				ThirdActivity.this.startActivity(it);
				ThirdActivity.this.finish();
			}
		});
		btnhome.setOnClickListener(new View.OnClickListener() {
			
			@Override
			public void onClick(View v) {
				// TODO Auto-generated method stub
				Intent it = new Intent();
				it.setClass(ThirdActivity.this, MainActivity.class);
				ThirdActivity.this.startActivity(it);
				ThirdActivity.this.finish();
			}
		});
		
	}

	private void initView() {
		// TODO Auto-generated method stub
		btnrst = (Button)findViewById(R.id.btn_restart);
		btnhome = (Button)findViewById(R.id.btn_home);
		tvend = (TextView)findViewById(R.id.textView1);
	}

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		// Inflate the menu; this adds items to the action bar if it is present.
		getMenuInflater().inflate(R.menu.third, menu);
		return true;
	}

}
